package com.dianpingmedia.simulate.configuration;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties(prefix = "simulate")
@Configuration
public class SimulateConfiguration {
    private String dp_planentry_url;
    private String storage_directory;
    private String outnet;

    public String getOutnet() {
        return outnet;
    }

    public void setOutnet(String outnet) {
        this.outnet = outnet;
    }

    public String getStorage_directory() {
        return storage_directory;
    }

    public void setStorage_directory(String storage_directory) {
        this.storage_directory = storage_directory;
    }

    public ZMTConfiguration getZmtConfiguration() {
        return zmtConfiguration;
    }

    public void setZmtConfiguration(ZMTConfiguration zmtConfiguration) {
        this.zmtConfiguration = zmtConfiguration;
    }

    public IFlyConfiguration getiFlyConfiguration() {
        return iFlyConfiguration;
    }

    public void setiFlyConfiguration(IFlyConfiguration iFlyConfiguration) {
        this.iFlyConfiguration = iFlyConfiguration;
    }

    @Autowired
    public ZMTConfiguration zmtConfiguration;

    @Autowired
    public IFlyConfiguration iFlyConfiguration;


    public String getDp_planentry_url() {
        return dp_planentry_url;
    }

    public void setDp_planentry_url(String dp_planentry_url) {
        this.dp_planentry_url = dp_planentry_url;
    }

    @ConfigurationProperties(prefix = "simulate.zm")
    @Configuration
    public class ZMTConfiguration {
        private String token;
        private Integer delay;
        private String channel_id;

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public Integer getDelay() {
            return delay;
        }

        public void setDelay(Integer delay) {
            this.delay = delay;
        }

        public String getChannel_id() {
            return channel_id;
        }

        public void setChannel_id(String channel_id) {
            this.channel_id = channel_id;
        }

        @Override
        public String toString() {
            return "ZMTConfiguration{" +
                    "token='" + token + '\'' +
                    ", delay=" + delay +
                    ", channel_id='" + channel_id + '\'' +
                    '}';
        }
    }

    @ConfigurationProperties(prefix = "simulate.xf")
    @Configuration
    public class IFlyConfiguration {

        private String token;
        private String ssp_id;
        private Integer delay;
        private String secret_key;


        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public String getSsp_id() {
            return ssp_id;
        }

        public void setSsp_id(String ssp_id) {
            this.ssp_id = ssp_id;
        }

        public Integer getDelay() {
            return delay;
        }

        public void setDelay(Integer delay) {
            this.delay = delay;
        }

        public String getSecret_key() {
            return secret_key;
        }

        public void setSecret_key(String secret_key) {
            this.secret_key = secret_key;
        }

        @Override
        public String toString() {
            return "IFlyConfiguration{" +
                    "token='" + token + '\'' +
                    ", ssp_id='" + ssp_id + '\'' +
                    ", delay=" + delay +
                    ", secret_key='" + secret_key + '\'' +
                    '}';
        }
    }


    @Override
    public String toString() {
        return "SimulateConfiguration{" +
                "dp_planentry_url='" + dp_planentry_url + '\'' +
                ", zmtConfiguration=" + zmtConfiguration +
                ", iFlyConfiguration=" + iFlyConfiguration +
                '}';
    }

}
